package com.hbnu.system.controller;



import com.hbnu.system.core.base.Rest;
import com.hbnu.system.model.entity.AchievementQualification;
import com.hbnu.system.service.AchievementQualificationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * (AchievementQualification)表控制层
 *
 * @author makejava
 * @since 2025-07-22 22:24:49
 */
@RestController
@RequestMapping("/achievementQualification")
@Api(tags = "科研成果量化模块")
public class AchievementQualificationController {
    @Autowired
    private AchievementQualificationService iAchievementQualificationService;

    @ApiOperation("科研成果量化添加")
    @PostMapping("/addAchievementQualification")
    public Rest<Boolean> addAchievementQualification(@RequestBody AchievementQualification achievementQualification){
        boolean add = iAchievementQualificationService.addAchievementQualification(achievementQualification);
        return add ? Rest.success() : Rest.failed();
    }

    @ApiOperation("科研成果量化删除")
    @GetMapping("/deleteAchievementQulification")
    public Rest<Boolean> deleteAchievementQulification(String AchievementQualificationID){
        boolean delete = iAchievementQualificationService.deleteAchievementQualification(AchievementQualificationID);
        return delete ? Rest.success() : Rest.failed();
    }

    @ApiOperation("科研成果量化查看")
    @GetMapping("/getAchievementQulification")
    public Rest<List<AchievementQualification>> getAchievementQulification(String AchievementID){
        List<AchievementQualification> oneAchievement_qualification = iAchievementQualificationService.getOneAchievementQualification(AchievementID);

        return Rest.success(oneAchievement_qualification);
    }

    @ApiOperation("校级管理员修改量化分数")
    @PostMapping("/upAchievementScore")
    public Rest<Boolean> upAchievementScore(@RequestBody AchievementQualification achievementQualification){
        boolean update = iAchievementQualificationService.upAchievementScore(achievementQualification);
        return update ? Rest.success() : Rest.failed();
    }
}

